package com.jie.component.exception.base;


import com.jie.component.exception.enums.BusinessError;
import lombok.Getter;

/**
 * @author jie
 * @version 1.0 2025-02-10 业务异常
 */
@Getter
public class BusinessException extends BaseException {
    private final Integer code;

    private final String msg;

    public BusinessException(BusinessError error) {
        this.code = error.getCode();
        this.msg = error.getMsg();
    }

    public BusinessException(String msg) {
        this.msg = msg;
        this.code = 500;
    }

    public BusinessException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
